package com.itcc.dao;

import com.itcc.domain.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface UserDao {

    @Select("select username from user")
    public String[] getUserName();

    @Select("select * from user where username=#{username}")
    public User login(@Param("username") String username);

    @Insert("insert into user(username, password) values(#{username}, #{password})")
    public boolean register(@Param("username") String username, @Param("password") String password);

}
